<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>Title</title>

</head>
<body>
                                       <table border="2" cellspacing="0" cellpadding="0" >

 
                                                 <tr align="center"> 
                                                     <th width="50">头像</th> 
                                                     <th width="100">昵称</th> 
                                                     <th width="450">说了什么</th> 
                                                 </tr>
<?php
    require_once 'shujvku.php';
    $sql = "SELECT * FROM t_message";
    $result = $conn->query($sql);

 ?> 
                            
                            
<?php if ($result->num_rows > 0) : ?>                          
    <?php 
        $rows = $result->fetch_all(MYSQLI_ASSOC);
        foreach($rows as $row): ?>                                                    
                                                 
                                                <tr>
                                                
                                                    
                              
                                                    <td align="center"><img src="<?php echo $row['avater']; ?>" alt=""></td> 
                                                    <td align="center"><?php echo $row['username']; ?></td>
                                                    <td><?php echo $row['content']; ?></td> 
                                                </tr> 
                <?php endforeach;?>
                                        
                <?php else : ?>                       
                                        <p>0 个结果</p>
                <?php endif; ?>                                                
                                                
                                                
 
                                       
                                       </table>
    
    
</body>